Twilio action#39
Merged
Merged
Conversation
Introduce a new twilio-action that integrates with the Twilio Messages API for Hercules automations. Version 1 provides the core capability of sending messages (SMS, MMS, and channel messages such as WhatsApp). - sendMessage runtime function (To, Body, optional From and MediaUrl) - TWILIO_MESSAGE response data type modeling the Twilio message resource - Action configs: account_sid, auth_token, from_number, base_url - Follows the existing action conventions (hercules decorators + axios REST client, zod-backed schemas), mirroring the gls-action layout - Register twilio-action in the .gitlab-ci.yml node-actions matrix Refs #33 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hrvb3LRhmxcrASCuSXc7Jn
Replace the raw axios + Twilio REST client with the official `twilio` Node SDK for sending messages. - helpers.ts uses twilio(accountSid, authToken) and client.messages.create, mapping the returned MessageInstance onto the TWILIO_MESSAGE schema - package.json: drop axios, add twilio - vite.config.ts: externalize twilio so it loads from node_modules at runtime - index.ts: drop the now-unnecessary base_url config (the SDK targets api.twilio.com directly) NOTE: package-lock.json must be regenerated with `npm install` so it matches the new dependency set before CI's `npm ci` can succeed. Refs #33 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hrvb3LRhmxcrASCuSXc7Jn
GitLab Pipeline ActionGeneral informationLink to pipeline: https://gitlab.com/code0-tech/development/centaurus/-/pipelines/2699655427 Status: Passed Job summariesdocs:previewDocumentation preview available at https://code0-tech.gitlab.io/-/development/telescopium/-/jobs/15493880037/artifacts/out/index.html |
Replace the hand-written TWILIO_MESSAGE zod schema with one generated from Twilio's official OpenAPI specification (twilio/twilio-oai, spec/json/twilio_api_v2010.json), mirroring the woocommerce-action and shopware-action generation pipeline. - scripts/filterTwilioSpec.mjs reduces the large v2010 spec to the api.v2010.account.message component, re-exposed as `TwilioMessage` - scripts/patchGeneratedSchemas.mjs applies the zod v3 -> v4 z.record fix - package.json: add openapi-zod-client and a generate:twilio-schemas script - twilioMessage.ts now uses schemas.TwilioMessage from the generated file NOTE: run `npm install && npm run generate:twilio-schemas` to produce and commit src/generated/twilio-schemas.ts; the action does not build until that generated file exists. Refs #33 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hrvb3LRhmxcrASCuSXc7Jn
…mes for Twilio integration
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Close #33